package cn.yangliu.nacos.management.service.sys;

import java.util.List;

import cn.yangliu.jpa.base.service.JpaService;
import cn.yangliu.nacos.management.entity.sys.Authority;
import cn.yangliu.nacos.management.model.AuthorityInsertModel;
import cn.yangliu.nacos.management.model.AuthorityUpdateModel;

/**
 * The type of nacos.
 *
 * @author 问道于盲
 * @date 2020 -01-01
 */
public interface AuthorityService extends JpaService<Authority, Long> {

    /**
     * Insert authority.
     *
     * @param model the model
     * @return the authority
     */
    Authority insert(AuthorityInsertModel model);

    /**
     * Update authority.
     *
     * @param model the model
     * @return the authority
     */
    Authority update(AuthorityUpdateModel model);

    /**
     * Find authorities by oauth 2 id list.
     *
     * @param oauth2Id the oauth 2 id
     * @return the list
     */
    List<Authority> findAuthoritiesByOauth2Id(Long oauth2Id);

    /**
     * Find all authorities list.
     *
     * @return the list
     */
    List<Authority> findAllAuthorities();
}
